#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

template<typename T=int>
inline T read() {
    T x;
    cin >> x;
    return x;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n = read();
    vector<int> a(n);
    for (auto &e:a)cin >> e;
    auto m = unique(a.begin(), a.end());
    copy(a.begin(), m, ostream_iterator<int>(cout, " "));


    return 0;
}
